package com.ycx.ycxmybatismanagement.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {
    Integer code;
    String msg;
    T data;
    public static Result success(){
        Result result = new Result();
        result.setCode(1);
        return result;
    }
    public static  <T>Result<T> success(T data){
        Result<T> result = new Result<>();
        result.setData(data);
        result.setCode(1);
        return result;
    }
    public static Result error (String msg){
        Result result = new Result();
        result.setMsg(msg);
        return result;
    }
}
